Here is my code:
public static class DynamicExtensions
public static void Add(this ExpandoObject obj, string path){
dynamic _obj = obj;
if (_obj == null) throw new ArgumentNullException("obj");
_obj.path = path;
}
}
But I got the error of "'System.Dynamic.ExpandoObject' does not contain a definition for 'Add'", when I call it in this way:
dynamic obj = new ExpandoObject();
obj.Add("p1");
How to fix it?
Thanks in advance!